import {Component} from 'angular2/core';
import {NgForm} from 'angular2/common';
import {Hero} from './hero';
import {TelphoneValidator, EmailValidator} from './selfValidator'

@Component({
  selector: 'hero-form',
  templateUrl: 'app/form/hero-form.component.html',
  styleUrls: ['app/form/hero-form.component.css'],
  directives: [TelphoneValidator, EmailValidator]
})
export class HeroFormComponent {
  birthday = new Date(1988,3,15); // April 15, 1988
  
  powers = ['Really Smart', 'Super Flexible',
            'Super Hot', 'Weather Changer'];
            
  model = new Hero(18, 'Dr IQ', this.powers[0], 'Chuck Overstreet');
  
  submitted = false;
  
  onSubmit(form: any) { 
    this.submitted = true;
  }
  
  // TODO: Remove this when we're done
  get diagnostic() { return JSON.stringify(this.model); }
}



